/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */


package org.apache.skywalking.apm.agent.core.dictionary;

/**
 * 在前文介绍 SkyWalking 基本使用时看到，Trace 数据中包含了请求的 URL 地址、RPC 接口名称、HTTP 服务
 * 或 RPC 服务的地址、数据库的 IP 以及端口等信息，这些信息在整个服务上线稳定之后，不会经常发生变动。而在
 * 海量 Trace 中包含这些重复的字符串，会非常浪费网络带宽以及存储资源，常见的解决方案是将字符串映射成数字编
 * 号并维护一张映射表，在传输、存储时使用映射后的数字编号，在展示时根据映射表查询真正的字符串进行展示即可。
 * 这类似于编码、解码的思想。SkyWalking 也是如此处理 Trace 中重复字符串的。
 */
public class DictionaryManager {
    /**
     * @return {@link NetworkAddressDictionary} to find application id for application code and network address.
     */
    // 用于同步网络地址的映射关系。
    public static NetworkAddressDictionary findNetworkAddressSection() {
        return NetworkAddressDictionary.INSTANCE;
    }

    /**
     * @return {@link EndpointNameDictionary} to find service id.
     */
    // 用于同步 Endpoint 字符串的映射关系。
    public static EndpointNameDictionary findEndpointSection() {
        return EndpointNameDictionary.INSTANCE;
    }
}
